package com.example.utils;

import java.util.Random;

public class SaltUtils {

    //静态生成随机盐
    public static String getSalt(int n) {
        char[] chars = "asdfghjklqweAZHDNDKAKKDKFJDAFJ5542289631752".toCharArray();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < n; i++) {
            char saltChar = chars[new Random().nextInt(chars.length)];
            sb.append(saltChar);
        }
        return sb.toString();
    }
}
